<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>过渡效果2</title>
    <style>
        .sample {
            width: 300px;
            height: 400px;
            background-color: chartreuse;
            transition: all 1s;   /* transition过渡效果是一个复合属性，其中all表示所有修改的属性生效，1s表示过渡时间 */
        }

        .sample:hover {
            width: 400px;
            height: 500px;
            background-color: crimson;
        }
    </style>
</head>
<body>
    <div class="sample">

    </div>
</body>
</html>